﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FieldHost;

namespace Field {
	public class Market {

		#region Constructor

		public Market() {
			Prime = new MetaField<double> {
				MinValue = 0,
				MaxValue = 1,
				IsBoundCheckActive = true
			};

			DidDemandCalc = new MetaField<bool> {
				Value = false
			};

			FGPriceIndustry = new MetaField<int> {
				MinValue = 0
			};

			IsFirstYearMemoTriggered = new MetaField<bool> {
				Value = false
			};

			IsCustProfitabilityMemoTriggered = new MetaField<bool> {
				Value = false
			};

			IsCustVisitMemoTriggered = new MetaField<bool> {
				Value = false
			};

			IsFinMgmtMemoTriggered = new MetaField<bool> {
				Value = false
			};

			IsBuyCapacityMemoTriggered = new MetaField<bool> {
				Value = false
			};

			IsNegotiationsMemoTriggered = new MetaField<bool> {
				Value = false
			};
		} 

		#endregion

		/// <summary>
		/// Base interest rate for loans, in percentages.
		/// </summary>
		public MetaField<double> Prime {
			get;
			private set;
		}

		//Economic growth factor per region and customer type
		private readonly SpecializedMatrix<int, int, MetaField<double>> _gnp = new SpecializedMatrix<int, int, MetaField<double>>();
		/// <summary>
		/// Economic growth factor per region and customer type
		/// </summary>
		public IList<MetaField<double>> GrowthPerCustomerType {
			get{
				throw new NotImplementedException("pending");
			}
		}

		private readonly SpecializedMatrix<int, int, MetaField<double>> _cGnp = new SpecializedMatrix<int, int, MetaField<double>>();
		/// <summary>
		/// Economic growth factor per region and specific customer
		/// cGnp(LOW_REG To HIGH_REG, LOW_INDCUST To HIGH_INDCUST) As Single
		/// </summary>
		public IList<MetaField<double>> GrowthPerCustomer {
			get {
				throw new NotImplementedException("pending");
			}
		}

		
		private readonly SpecializedMatrix<int, int, MetaField<int>> _demand = new SpecializedMatrix<int, int, MetaField<int>>();
		/// <summary>
		/// Demand by region and specific customer
		/// Ddemand(LOW_REG To HIGH_REG, LOW_INDCUST To HIGH_INDCUST) As Long
		/// </summary>
		public IList<MetaField<int>> DemandPerCustomer {
			get {
				throw new NotImplementedException("pending");
			}
		}
				
		private readonly SpecializedMatrix<int, int, MetaField<double>> _demandModifier = new SpecializedMatrix<int, int, MetaField<double>>();
		/// <summary>
		/// Demand Modifier by region and specific customer
		/// demandModifier(LOW_REG To HIGH_REG, LOW_INDCUST To HIGH_INDCUST) As Single
		/// </summary>
		public IList<MetaField<double>> DemandModifierPerCustomer {
			get {
				throw new NotImplementedException("pending");
			}
		}

		/// <summary>
		/// Was the demand already processed?
		/// </summary>
		public MetaField<bool> DidDemandCalc {
			get;
			private set;
		}
		
		/// <summary>
		/// Finished Goods Price Industry
		/// </summary>
		public MetaField<int> FGPriceIndustry {
			get;
			private set;
		}

		public MetaField<bool> IsFirstYearMemoTriggered {
			get;
			private set;
		}

		public MetaField<bool> IsCustProfitabilityMemoTriggered {
			get;
			private set;
		}

		public MetaField<bool> IsCustVisitMemoTriggered {
			get;
			private set;
		}

		public MetaField<bool> IsFinMgmtMemoTriggered {
			get;
			private set;
		}

		public MetaField<bool> IsNegotiationsMemoTriggered {
			get;
			private set;
		}

		public MetaField<bool> IsBuyCapacityMemoTriggered {
			get;
			private set;
		}

	}
}
